home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 8
/
Amoszine 8 (Disk 2 of 3).adf
/
Powerbobs.lha
/
powerbobsv1.0
/
examples
/
powerbobs_shootemup.asc
< prev
next >
Wrap
Text File
|
1995-07-04
|
2KB
|
105 lines
' A SIMPLE SHOOT AND DODGE THE ASTEROIDS GAME
' CODED BY ANDY DOBINSON
'
' Adapted by PowerSoft.
'
Load "df0:examples/shootemup.abk"
'
Amos Lock
Screen Open 1,320,192,16,L
Screen Close 0
Flash Off : Curs Off : Cls 0 : Hide On
Get Sprite Palette
Unpack 10 To 1
X=50 : Y=100
SFIRE=False
Dim X(10),Y(10),SPEED(10),IMAGE(10)
For T=1 To 10
X(T)=320 : Y(T)=Rnd(150) : SPEED(T)=-(Rnd(4)+1) : IMAGE(T)=3
Next T
Double Buffer : Autoback 0 : Bob Update Off
Reserve Pbobs 12
Pbob Dbuf True
Make Mask
For T=1 To 12 : Pbob Height T,40 : Next T
Wait 50
Break Off : Multi No : E=Execall(-132)
Repeat
If Jup(1)
Add Y,-4
End If
If Jdown(1)
Add Y,4
End If
If Jright(1)
Add X,4
End If
If Jleft(1)
Add X,-4
End If
If Fire(1) and SFIRE=False
SFIRE=True
A=X : B=Y
Y1=B : Y2=B : X3=A
End If
'*** phew this is slow
' For T=1 To 10
' Add X(T),-SPEED(T)
' If X(T)<0 Then X(T)=320 : Y(T)=Rnd(150) : SPEED(T)=-(Rnd(4)+1)
' Pbob T,X(T),Y(T),3
' Next T
'*** get some more speed hehe...
Psum Varptr(X(0)),Varptr(SPEED(0)),1 To 10
For T=1 To 10
If X(T)<0
X(T)=320
Y(T)=Rnd(150)
SPEED(T)=-(Rnd(4)+1)
End If
Next
Pbob Varptr(X(1)),Varptr(Y(1)),Varptr(IMAGE(1)),1 To 10
If SFIRE
X1=A
X2=A
Y3=B
If X3<320
Add X3,6
Pbob 12,X3,Y3,2
Else
X3=320
SFIRE=False
Pbob Off 12
End If
End If
Pbob 11,X,Y,1
_BLOCK_HIT=Pbob Fastcol(12,1 To 10)
If _BLOCK_HIT
_BOB=Pfast Bobcol(-1)
X(_BOB)=320
Y(_BOB)=Rnd(150)
SPEED(_BOB)=-(Rnd(4)+1)
Pbob _BOB,X(_BOB),Y(_BOB),3
SFIRE=False
Pbob Off 12
End If
SHIP_HIT=Pbob Fastcol(11,1 To 10)
If SHIP_HIT
SHIP_SHAKE=True
SHAKER=0
End If
If SHIP_SHAKE
Inc SHAKER
Pbob 11,X,Y+Rnd(9)-Rnd(7),1
If SHAKER=40
SHIP_SHAKE=False
End If
End If
Pbob Clear 1 To 12
Pbob Draw 1 To 12
Screen Swap
Wait Vbl
Until Left Click
Erase 1 : Erase 10
Multi Yes : E=Execall(-138)
Amos Unlock